package com.shiwaixiangcun.monitor.domain;

import com.rabbit.spring.data.domain.BaseEntity;
import com.shiwaixiangcun.monitor.enums.QualityStatus;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * 工单质检记录
 */
@Entity
@Table(name = "ms_work_order_quality_record")
@DynamicUpdate
@DynamicInsert
public class WorkOrderQualityRecord extends BaseEntity<Long> {

    @ManyToOne
    @JoinColumn(name = "work_order_id")
    private WorkOrder workOrder;

    @ManyToOne
    @JoinColumn(name = "user_id")
    private User user;

    @Enumerated(EnumType.STRING)
    private QualityStatus status; // 质检状态（待检：WAIT，驳回：NO_PASS, 通过：PASS）

    private String reason; // 理由

    public WorkOrderQualityRecord() {
    }

    public WorkOrder getWorkOrder() {
        return workOrder;
    }

    public void setWorkOrder(WorkOrder workOrder) {
        this.workOrder = workOrder;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public QualityStatus getStatus() {
        return status;
    }

    public void setStatus(QualityStatus status) {
        this.status = status;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }
}
